var timer;

function setTimer(interval) {
	window.clearTimeout(timer);
	timer = window.setTimeout(function() {
		location.reload(true);
		setTimer(widget.preferences.imago_image_refreshTime);
	}, interval * 1000 );
}

function prefChange() {
	setTimer(0);
}

window.addEventListener('load', function() {
	if( eval(widget.preferences.imago_image_refresh) ) {
		setTimer(widget.preferences.imago_image_refreshTime);
	}
});




	

